home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / DOSASUTL.ASM < prev    next >
Assembly Source File  |  1992-05-05  |  2KB  |  99 lines

  1. ;;; -*-Midas-*-
  2. ;;;
  3. ;;;    $Header: /scheme/dos386/microcode/RCS/dosasutl.asm,v 1.1 1992/05/05 06:55:13 jinx Exp $
  4. ;;;
  5. ;;;    Copyright (c) 1992 Massachusetts Institute of Technology
  6. ;;;
  7. ;;;    This material was developed by the Scheme project at the
  8. ;;;    Massachusetts Institute of Technology, Department of
  9. ;;;    Electrical Engineering and Computer Science.  Permission to
  10. ;;;    copy this software, to redistribute it, and to use it for any
  11. ;;;    purpose is granted, subject to the following restrictions and
  12. ;;;    understandings.
  13. ;;;
  14. ;;;    1. Any copy made of this software must include this copyright
  15. ;;;    notice in full.
  16. ;;;
  17. ;;;    2. Users of this software agree to make their best efforts (a)
  18. ;;;    to return to the MIT Scheme project any improvements or
  19. ;;;    extensions that they make, so that these may be included in
  20. ;;;    future releases; and (b) to inform MIT of noteworthy uses of
  21. ;;;    this software.
  22. ;;;
  23. ;;;    3. All materials developed as a consequence of the use of this
  24. ;;;    software shall duly acknowledge such use, in accordance with
  25. ;;;    the usual standards of acknowledging credit in academic
  26. ;;;    research.
  27. ;;;
  28. ;;;    4. MIT has made no warrantee or representation that the
  29. ;;;    operation of this software will be error-free, and MIT is
  30. ;;;    under no obligation to provide any services, by way of
  31. ;;;    maintenance, update, or otherwise.
  32. ;;;
  33. ;;;    5. In conjunction with products arising from the use of this
  34. ;;;    material, there shall be no use of the name of the
  35. ;;;    Massachusetts Institute of Technology nor of any adaptation
  36. ;;;    thereof in any advertising, promotional, or sales literature
  37. ;;;    without prior written consent from MIT in each case.
  38. ;;;
  39.  
  40. .386
  41. .model small
  42.     .code
  43.  
  44.     public    _getCS
  45. _getCS:
  46.     xor    eax,eax            ; clear eax
  47.     mov    ax,cs            ; copy code segment descriptor
  48.     ret
  49.  
  50.     public    _getSS
  51. _getSS:
  52.     xor    eax,eax            ; clear eax
  53.     mov    ax,ss            ; copy code segment descriptor
  54.     ret
  55.  
  56. ;;    Frame on entry to farcpy
  57.  
  58. ;;24    size
  59. ;;20    src_sel
  60. ;;16    src_off
  61. ;;12    dst_sel
  62. ;;8    dst_off
  63. ;;4    ret add
  64. ;;0    previous ebp
  65.  
  66.     public    _farcpy
  67. _farcpy:
  68.     push    ebp
  69.     mov    ebp,esp
  70.     push    ebx
  71.     push    ds
  72.     push    es
  73.  
  74.     mov    eax,12[ebp]
  75.     mov    ds,ax            ; dst sel
  76.     mov    eax,20[ebp]
  77.     mov    es,ax            ; src sel
  78.     mov    edx,8[ebp]        ; dst off
  79.     mov    ecx,16[ebp]        ; src off
  80.     mov    eax,24[ebp]        ; count
  81.     jmp    enter_loop
  82.  
  83. farcpy_loop:
  84.     mov    bl,es:[ecx]
  85.     mov    ds:[edx],bl
  86.     inc    ecx
  87.     inc    edx
  88.  
  89. enter_loop:
  90.     dec    eax
  91.     jge    farcpy_loop
  92.  
  93.     pop    es
  94.     pop    ds
  95.     pop    ebx
  96.     pop    ebp
  97.     ret
  98. end
  99.